package lhc.alg.top100;

/**
 * description: https://leetcode.cn/problems/excel-sheet-column-title/
 *  excel表列名称
 * author: hongchen.liao
 * date:  2022/9/8
 */
public class _168_ {

    class Solution {
        public String convertToTitle(int columnNumber) {
            StringBuffer sb = new StringBuffer();
            while(columnNumber != 0){
                columnNumber--;
                sb.append((char)(columnNumber % 26 + 'A'));
                columnNumber /= 26;
            }
            return sb.reverse().toString();
        }
    }

}
